<template>
	<view>
		<!-- <view @tap="$navTo('/ipo_list')"> -->
		<view @tap="$navTo('/')">
			<button class="btn">{{$t('pages.ipo-list')}}</button>
		</view>
		<view @tap="$navTo('/to_be_list')">
			<button class="btn">{{$t('pages.to-be-list')}}</button>
		</view>
		<view @tap="$navTo('/ipo_details')">
			<button class="btn">{{$t('pages.ipo-details')}}</button>
		</view>
		<view @tap="$navTo('/subscription')">
			<button class="btn">{{$t('pages.subs-stock')}}</button>
		</view>
		<view @tap="$navTo('/orders_history')">
			<button class="btn">{{$t('pages.order-history')}}</button>
		</view>
		<view @tap="$navTo('/order_details',{cash_type:'financing'})">
			<button class="btn">{{$t('pages.order-details')}}({{$t('financing')}})</button>
		</view>
		<view @tap="$navTo('/order_details',{cash_type:'cash'})">
			<button class="btn">{{$t('pages.order-details')}}({{$t('cash')}})</button>
		</view>
		
		<view @tap="changeLocale('zh-Hans')">
			<button class="btn">切换中文</button>
		</view>
		<view @tap="changeLocale('en')">
			<button class="btn">English</button>
		</view>
		<view style="text-align: center; line-height: 2;">
			当前语言：{{now_locale}}
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				now_locale:'',
				isAndroid:'',
			}
		},
		onLoad() {
			uni.onLocaleChange((e) => {
				this.now_locale = e.locale;
			})	
		},
		methods: {
			to_check_subscripti(){
				this.$Router.push({
				    path: '/order_details'
				});
				// uni.navigateTo({
				// 	url:'check_subscripti'
				// })
			},
			to_subscribe(){
				this.$Router.push({
				    path: '/list'
				});
				// uni.navigateTo({
				// 	url:'subscribe'
				// })
			},
			to_applybuy(){
				this.$Router.push({
				    path: '/subscription'
				});
				// uni.navigateTo({
				// 	url:'applybuy'
				// })
			},
			to_newcertification(){
				this.$Router.push({
				    path: '/ipo_details'
				});
				// uni.navigateTo({
				// 	url:'new-certification'
				// })
			},
			to_subscribe_record(){
				this.$Router.push({
				    path: '/orders_history'
				});
				// uni.navigateTo({
				// 	url:'subscribe_record'
				// })
			},
			changeLocale(lang){
				uni.setLocale(lang);
				this.$i18n.locale = lang;
			}
			
		}
	}
</script>

<style lang="scss">
.btn {
		border-radius: 8rpx;
		margin-top: 20rpx;
		background-color: $buttton-color-one;
		text-align: center;
		height: 94rpx;
		width: 690rpx;
		line-height: 90rpx;
		color: #FFFFFF;
		font-size: 30rpx;
	}
</style>
